#ifndef GLWIDGET_H
#define GLWIDGET_H

#include <QGLWidget>

class GLWidget : public QGLWidget
{
	Q_OBJECT

public:
	GLWidget(QWidget *parent = 0);
	~GLWidget();

	QSize minimumSizeHint() const;
	QSize sizeHint() const;

signals:
	void rotationSet(float x, float y);
	void zoomSet(float z);

public slots:
	void setRotation(float x, float y) {xRot=x; yRot=y; repaint();}
	void setZoom(float z) {zCam=z; repaint();}

protected:
	void initializeGL();
	void paintGL();
	void resizeGL(int width, int height);
	void mousePressEvent(QMouseEvent *event);
	void mouseMoveEvent(QMouseEvent *event);
	void wheelEvent(QWheelEvent *event);

private:
	QPoint lastPos;

	GLfloat xRot,yRot;
	GLfloat zCam;
};

#endif
